<template>
  <div>
    父组件：{{ num }}
    <Son ref="refSon" :num="num" />
    <button @click="changeNum">changeNum</button>
  </div>
</template>
<script>
import Son from './Son.vue'
export default {
  components: { Son },
  data() {
    return { num: 1 }
  },
  methods: {
    changeNum() {
      this.num = 2
      console.log(this.num) // 父组件中的数据

      setTimeout(() => {
        console.log('setTimeout', this.$refs.refSon.num) // 获取到的子组件中的props
      })

      this.$nextTick(() => {
        console.log('nextTick', this.$refs.refSon.num) // 获取到的子组件中的props
      })
    }
  }
}
</script>
